package 笔试.美团;

import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        char[] cs = str.trim().toCharArray();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < cs.length; i++) {
            if(cs[i]==' '|| sb.length()>0 && sb.charAt(sb.length()-1)==cs[i]){
                continue;
            }else{
                sb.append(cs[i]);
            }
        }
        System.out.println(sb);


    }


}
